package cn.mingfancloud.test.面向对象综合训练;

public class GameAttack {
    public static void main(String[] args) {
        //创建角色

        Role r1 = new Role("桂云飞",100,'男');
        Role r2 = new Role("朱志明",100, '男');

        r1.showRoleInfo();
        r2.showRoleInfo();
        while (true){
            r1.attack(r2);
            if (r2.getBlood() == 0) {
                System.out.println(r1.getName()+"KO"+ r2.getName());break;
            }

            r2.attack(r1);
            if (r1.getBlood() == 0) {
                System.out.println(r2.getName()+"KO"+ r1.getName());break;
            }

        }

//        while (true){
//            r1.attack(r2);
//            if (r2.getBlood() == 0) {
//                System.out.println(r1.getName()+"KO"+ r2.getName());break;
//            }
//
//            r2.attack(r1);
//            if (r1.getBlood() == 0) {
//                System.out.println(r2.getName()+"KO"+ r1.getName());break;
//            }
//
//        }

    }
}

